package lzzy15;


public class GreetStudents {
    public static void main(String[] args) {
        Runnable print1 = new PrintChar("hello TiMi", 50);
        Runnable print2 = new PrintChar("goodbye", 50);
        Thread thread1 = new Thread((print1));
        Thread thread2 = new Thread((print2));
        thread1.start();
        thread2.start();

        lzzy15.Student stu1 = new lzzy15.Student("1258","大哥","男");
        lzzy15.Student stu2 = new lzzy15.Student("1259","大嫂","女");
        lzzy15.Student stu3 = new lzzy15.Student("1260","二哥","男");
        lzzy15.Student[]  studs1 = {stu1,stu2,stu3};
        Runnable printStudent = new StudenInFo(studs1);
        Thread thread3 = new Thread((printStudent));
        thread3.start();
    }

    // 任务一
    public static class PrintChar implements Runnable {
        private String greeting;
        private int count;

        public PrintChar(String g, int c) {
            greeting = g;
            count = c;
        }

        @Override
        public void run() {
            for (int i = 0; i <= count; i++) {
                System.out.println(greeting);
            }
        }
    }

}